﻿@{
    ViewBag.Title = "用户组管理";
}
@section headerSection{
    <style>
        #exampleToolbar > .form-group {
            float: left;
            margin: 0;
            margin-left: 5px;
        }
    </style>
}
<div class="animated fadeInRight">
    <!-- Panel Other -->
    <div class="ibox float-e-margins" style="margin-bottom: 0px;">
        <div class="ibox-content" style="padding: 5px 20px 0px 20px;">
            <div class="row row-lg">
                <div class="col-sm-12 col-sm-leftRight">
                    <!-- Example Toolbar -->
                    <div class="example">
                        <div class="btn-group hidden-xs" id="exampleToolbar" role="group">
                            @{
                                List<string> folderList = (List<string>)ViewBag.elementList;
                                if (folderList.Contains("userGroupDetail"))
                                {
                                    <button id="userGroupDetail" type="button" class="btn btn-outline btn-primary">
                                        <i class="glyphicon glyphicon-th-large" aria-hidden="true">详细</i>
                                    </button>
                                }
                                if (folderList.Contains("userGroupAdd"))
                                {
                                    <button id="userGroupAdd" type="button" class="btn btn-outline btn-primary">
                                        <i class="glyphicon glyphicon-plus" aria-hidden="true">新增</i>
                                    </button>
                                }
                                if (folderList.Contains("userGroupEdit"))
                                {
                                    <button id="userGroupEdit" type="button" class="btn btn-outline btn-primary">
                                        <i class="glyphicon glyphicon-pencil" aria-hidden="true">编辑</i>
                                    </button>
                                }
                                if (folderList.Contains("userGroupDel"))
                                {
                                    <button id="userGroupDel" type="button" class="btn btn-outline btn-danger">
                                        <i class="glyphicon glyphicon-trash" aria-hidden="true">删除</i>
                                    </button>
                                }
                                if (folderList.Contains("btnSearch"))
                                {
                                    <div class="form-group">
                                        <input id="groupName" name="perName" type="text" class="form-control" placeholder="请输入用户组名称">
                                    </div>
                                    <div class="form-group" style="margin-top:-2px;">
                                        <select id="smCode" name="smCode" title="请选择所属模块" class="form-control show-tick selectpicker" placeholder="请选择所属模块"></select>
                                    </div>
                                    <div class="form-group">
                                        <button id="btnSearch" class="btn btn-primary" type="button"><i class="fa fa-search"></i>&nbsp;查询</button>
                                    </div>
                                }
                                if (folderList.Contains("btnUser"))
                                {
                                    <div class="form-group">
                                        <button id="btnUser" class="btn btn-primary" type="button" disabled="disabled"><i class="fa fa-search"></i>&nbsp;授权用户</button>
                                    </div>
                                }
                                if (folderList.Contains("btnRole"))
                                {
                                    <div class="form-group">
                                        <button id="btnRole" class="btn btn-primary" type="button" disabled="disabled"><i class="fa fa-search"></i>&nbsp;授权角色</button>
                                    </div>
                                }
                            }
                        </div>
                        <table id="exampleTableToolbar" data-mobile-responsive="true" data-radio="true"></table>
                    </div>
                    <!-- End Example Toolbar -->
                </div>
            </div>
        </div>
    </div>
    <!-- End Panel Other -->
</div>
<!-- 添加/编辑 -->
<div id="groupForm" style="width: 430px; overflow: hidden; display: none;">
    <form class="form-horizontal m-t" id="groupFormTable" method="post">
        <div class="form-group">
            <label class="col-sm-4 control-label">组名称<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-7">
                <input id="group_name" name="group_name" type="text" class="form-control input-sm" placeholder="请输入组名称" title="请输入组名称" required="" aria-required="true" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">组别名<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-7">
                <input id="group_cname" name="group_cname" type="text" class="form-control input-sm" placeholder="请输入组别名" title="请输入组别名" required="" aria-required="true" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">所属模块<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-7">
                <select id=sm_code title="请选择所属模块" name="sm_code" class="selectpicker show-tick bs-select-hidden" data-live-search="false" required="" aria-required="true" placeholder="请选择所属模块"></select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">备注：</label>
            <div class="col-sm-7">
                <textarea class="form-control" id="group_note" name="group_note" rows="3" placeholder="请输入备注信息" title="请输入备注信息"></textarea>
            </div>
        </div>
    </form>
</div>
@section footSection{
    <script src="~/Resources/myScript/SysAdmin/userGroupManager.js"></script>
    <script>
        $(function () {
            userGroupManager.initSelect();
            //初始化Table
            userGroupManager.initTable();
            //绑定事件
            userGroupManager.bindEvent();
        });
    </script>
}

